package com.feicheng.common.advice;

import com.feicheng.common.result.ResultInfo;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public abstract class CommonHandlerInterceptor implements HandlerInterceptor {

    protected void authFailOutput(HttpServletResponse response) throws IOException {
        response.setContentType("application/json;charset=UTF-8");
        PrintWriter out = response.getWriter();
        out.write(ResultInfo.loginFail().toJSONString());
        out.flush();
    }
}
